home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / c_toolbx.arc / KEYIO2.C < prev    next >
Encoding:
C/C++ Source or Header  |  1988-03-30  |  490 b   |  22 lines

  1. /*  keyio2.c - keyflush() and waitcr() functions */
  2. /* system-independant part of the keyboard input module */
  3.  
  4. #include   "stdio.h"
  5. #include   "keyio.h"
  6.  
  7. int  keyflush()         /* discard any waiting console input */
  8.   {
  9.                 /* repeat  */
  10.      while( keypress() != 0 )    /* check for input */
  11.     { getkey() ;  }     /* and discard if found */
  12.   }
  13.  
  14. int waitcr()            /* wait until a CR is typed */
  15.   {
  16.      while( getkey() != '\r' )  /* discard input until CR found */
  17.     { ; }
  18.   }
  19.  
  20.  
  21.  
  22.